package ecs.net.systems;

import ecs.core.BaseSystem;
import ecs.net.ByteBuffer;
import ecs.net.components.PackBufferComponent;

public class PackBufferInitSystem extends BaseSystem {

    public PackBufferInitSystem(){
        super();
        interestingComponentTypes(new Class[]{PackBufferComponent.class});
    }

    public void init()
    {
        entityComponents().forEach(components -> {
            PackBufferComponent packBuffer = (PackBufferComponent) components.get(0);
            packBuffer.buffer(new ByteBuffer(512));
            packBuffer.lenBuffer(new ByteBuffer(4));
        });
    }

}
